﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;


public partial class Controls_Common_ctrSlideImage : System.Web.UI.UserControl
{
    private int nPageCount = 0;
    private int nCurrentLanguage = Support.GetCurrentLanguage() - 1;
    private int nDefaultLanguage = Support.GetDefaultLanguage();
    private int nPageSize = Config.PAGESIZE;
    private int nPageIndex = 1;
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack){
            this.BindDataSlide();
        }
    }

    private void BindDataSlide()
    {
        Banner objBanner = new Banner();
        DataTable dtBbanner = new DataTable();
        dtBbanner = objBanner.GetAll();
        rptSlide.DataSource = dtBbanner;
        rptSlide.DataBind();
    }

    protected void rptSlide_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
        {
            Image imgSlide = (Image)e.Item.FindControl("imgSlide");
            imgSlide.ImageUrl = Config.ROOT + Config.IMAGE_BANNER_DEFAULT_UPLOAD + ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "Images"));
           
        }
    }
}
